﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:personalplaner.common.controls">


    <!-- 
    *****************************************************************
    Common styles 
    *****************************************************************
    -->
    <ResourceDictionary.MergedDictionaries>
        <!--<ResourceDictionary Source="/personalplaner.common;component/resources/CommonBrushes.xaml"/>-->
        <ResourceDictionary Source="/personalplaner.common;component/resources/CommonStyles.xaml"/>
    </ResourceDictionary.MergedDictionaries>
    
    <!-- 
    *****************************************************************
    PrintPreviewItemsControl Template 
    *****************************************************************
    -->

    <Style TargetType="{x:Type local:PrintPreviewItemsControl}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:PrintPreviewItemsControl}">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>

                        
                        
                        <Border BorderBrush="Black" BorderThickness="1" Margin="5" Background="White" HorizontalAlignment="Center" VerticalAlignment="Center" >
                            <Border.BitmapEffect>
                                <DropShadowBitmapEffect Color="Black" Softness="3" Opacity=".5"/>
                            </Border.BitmapEffect>
                            <Viewbox>
                                <Border BorderThickness="0" Background="Transparent" ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled" >
                                    <!--<ItemsPresenter />-->
                                    <!--<ContentPresenter ContentSource="{TemplateBinding SelectedItem}"/>-->
                                    <!--<ContentPresenter Content="{TemplateBinding SelectedItem}"/>-->
                                    <ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedItem" ContentTemplate="{TemplateBinding ItemTemplate}" ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled"/>
                                    
                                </Border>
                            </Viewbox>
                        </Border>

                        <!--<ScrollViewer VerticalScrollBarVisibility="Auto">
                            <Border BorderBrush="Black" BorderThickness="1" Background="#18ADD8E6" Opacity="0.7" Width="60" HorizontalAlignment="Right" VerticalAlignment="Top">

                                <Viewbox>
                                    <StackPanel IsItemsHost="True" />
                                </Viewbox>

                            </Border>
                        </ScrollViewer>-->
                        
                        <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Left" Margin="50,0,0,0">
                            <Button Style="{StaticResource TransparentButtonStyle}" x:Name="PART_PreviousButton" Margin="0,0,10,0" VerticalAlignment="Center">
                                <Path Data="M 7 0 L 6 0 L 0 5 L 6 10 L 7 10 Z" x:Name="LeftArrow" Stroke="Transparent" VerticalAlignment="Center">
                                    <Path.Fill>
                                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,20" MappingMode="Absolute">
                                            <LinearGradientBrush.GradientStops>
                                                <GradientStop Color="#FF808080" Offset="0" />
                                                <GradientStop Color="#FF000000" Offset="0.03" />
                                                <GradientStop Color="#FF000000" Offset="0.07" />
                                                <GradientStop Color="#FF808080" Offset="1" />
                                            </LinearGradientBrush.GradientStops>
                                        </LinearGradientBrush>
                                    </Path.Fill>
                                </Path>
                            </Button>

                            <TextBox Text="{Binding SelectedPageNumber, RelativeSource={RelativeSource TemplatedParent}}" MinWidth="40" VerticalAlignment="Center"/>
                            <TextBlock Text="/" HorizontalAlignment="Center" Margin="5,0,5,0" VerticalAlignment="Center"/>
                            <TextBlock Text="{Binding Items.Count, RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="Center"/>

                            <Button Style="{StaticResource TransparentButtonStyle}" x:Name="PART_NextButton" Margin="10,0,0,0" VerticalAlignment="Center">
                                <Path Data="M 0 0 L 1 0 L 7 5 L 1 10 L 0 10 Z" x:Name="RightArrow" Stroke="Transparent" VerticalAlignment="Center">
                                    <Path.Fill>
                                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,20" MappingMode="Absolute">
                                            <LinearGradientBrush.GradientStops>
                                                <GradientStop Color="#FFABADB3" Offset="0" />
                                                <GradientStop Color="#FF000000" Offset="0.03" />
                                                <GradientStop Color="#FF000000" Offset="0.07" />
                                                <GradientStop Color="#FFABADB3" Offset="1" />
                                            </LinearGradientBrush.GradientStops>
                                        </LinearGradientBrush>
                                    </Path.Fill>
                                </Path>
                            </Button>
                        </StackPanel>

                    </Grid>
                    
                    <ControlTemplate.Triggers>
                        <Trigger SourceName="PART_PreviousButton" Property="IsMouseOver" Value="True">
                            <Setter TargetName="LeftArrow" Property="Stroke" Value="GoldenRod"/>

                            <Setter TargetName="LeftArrow" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                        <LinearGradientBrush.GradientStops>
                                            <GradientStop Color="#FDFADE" Offset="0"/>
                                            <GradientStop Color="#FFEA96" Offset="1"/>
                                        </LinearGradientBrush.GradientStops>
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>

                        </Trigger>

                        <Trigger SourceName="PART_NextButton" Property="IsMouseOver" Value="True">
                            <Setter TargetName="RightArrow" Property="Stroke"  Value="GoldenRod"/>

                            <Setter TargetName="RightArrow" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                        <LinearGradientBrush.GradientStops>
                                            <GradientStop Color="#FDFADE" Offset="0"/>
                                            <GradientStop Color="#FFEA96" Offset="1"/>
                                        </LinearGradientBrush.GradientStops>
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                        </Trigger>

                        <Trigger SourceName="PART_PreviousButton" Property="IsEnabled" Value="False">
                            <Setter TargetName="LeftArrow" Property="Fill" Value="#81ABADB3"/>
                        </Trigger>

                        <Trigger SourceName="PART_NextButton" Property="IsEnabled" Value="False">
                            <Setter TargetName="RightArrow" Property="Fill"  Value="#81ABADB3"/>
                        </Trigger>
                        
                    </ControlTemplate.Triggers>
                    
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
</ResourceDictionary>